<header class="head-section">
  <div class="navbar navbar-default navbar-static-top container">
    <div class="navbar-header">
      <button class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse" type="button">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="${Site.link}"><span>思威控</span></a>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
          <a href="${Site.link}">首页</a>
        </li>
        <@cms_catalog alias="news" level="Self">
          <#list DataList as pcatalog>
            <li class="dropdown">
              <a class="dropdown-toggle" data-close-others="false" data-delay="0" data-hover="dropdown"
                data-toggle="dropdown" href="${pcatalog.link}">${pcatalog.name} <i class="fa fa-angle-down"></i>
              </a>
              <ul class="dropdown-menu">
                <@cms_catalog id="${pcatalog.catalogId}" level="Child">
                  <#list DataList as catalog>
                    <li>
                      <a href="${catalog.link}">${catalog.name}</a>
                    </li>
                  </#list>
                </@cms_catalog>
              </ul>
            </li>
          </#list>
        </@cms_catalog>
        <@cms_catalog alias="product" level="Self">
          <#list DataList as catalog>
            <li>
              <a href="${catalog.link}">${catalog.name}</a>
            </li>
          </#list>
        </@cms_catalog>
        <@cms_catalog alias="case" level="Self">
          <#list DataList as catalog>
            <li>
              <a href="${catalog.link}">${catalog.name}</a>
            </li>
          </#list>
        </@cms_catalog>
        <li class="dropdown">
          <@cms_catalog alias="support" level="Self">
            <#list DataList as catalog>
              <a class="dropdown-toggle" data-close-others="false" data-delay="0" data-hover="dropdown"
                data-toggle="dropdown" href="${catalog.link}">${catalog.name} <i class="fa fa-angle-down"></i>
              </a>
            </#list>
          </@cms_catalog>
          <ul class="dropdown-menu">
            <@cms_catalog alias="download" level="Self">
              <#list DataList as pcatalog>
                <li class="dropdown-submenu">
                  <a href="${pcatalog.link}" tabindex="-1">${pcatalog.name}</a>
                  <ul class="dropdown-menu">
                    <li class="dropdown-submenu"></li>
                    <@cms_catalog id="${pcatalog.catalogId}" level="Child">
                      <#list DataList as catalog>
                        <li>
                          <a href="${catalog.link}">${catalog.name}</a>
                        </li>
                      </#list>
                    </@cms_catalog>
                  </ul>
                </li>
              </#list>
            </@cms_catalog>
          </ul>
        </li>
        <@cms_catalog alias="tutorial" level="Self">
          <#list DataList as catalog>
            <li>
              <a href="${catalog.link}">${catalog.name}</a>
            </li>
          </#list>
        </@cms_catalog>
        <@cms_catalog alias="company" level="Self">
          <#list DataList as pcatalog>
            <li class="dropdown">
              <a class="dropdown-toggle" data-close-others="false" data-delay="0" data-hover="dropdown"
                data-toggle="dropdown" href="#">${pcatalog.name} <i class="fa fa-angle-down"></i>
              </a>
              <ul class="dropdown-menu">
                <@cms_catalog id="${pcatalog.catalogId}" level="Child">
                  <#list DataList as catalog>
                    <li>
                      <a href="${catalog.link}">${catalog.name}</a>
                    </li>
                  </#list>
                </@cms_catalog>
              </ul>
            </li>
          </#list>
        </@cms_catalog>
        <!-- 此部分需要创建别名是search的栏目
		<@cms_catalog alias="search" level="Self">
          <#list DataList as cc>
			<li><input class="form-control search" placeholder=" Search" id="header_search" type="text" s-link="${cc.link}"></li>
          </#list>
		</@cms_catalog> -->
      </ul>
    </div>
  </div>
</header>
<script>
	window.onload = function() {  
		document.getElementById('header_search').addEventListener('keyup', function(event) {  
		  if (event.key === 'Enter') {
			var link = $('#header_search').attr('s-link');
			if (link.indexOf('?') > -1) {
			  link += "&q=" + $('#header_search').val();
			} else {
			  link += "?q=" + $('#header_search').val();
			}
			window.location.href = link;
		  }  
		}); 
	};
</script>